﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Player : Father
    {
        public string name { get; set; }
        public Player() { }
        public Player(string name,Houquan CQ,Computer DN):base(CQ,DN) 
        {
            this.name = name;
        }
        public override void LiuBei()
        {
            int UU = 1;
            int JJ = 0;
            int KK = 0;
            Boolean q = true;
            while (q)
            {
                Random ran = new Random();
                int b;
                b = ran.Next(1, 4);
                Console.WriteLine("请出拳：1.剪刀 2.石头 3.布（输入相应数字：）");
                int a = int.Parse(Console.ReadLine());
                if (a == 1 && b == 1 )
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.剪刀);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a == 2 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.石头);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.石头);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a == 3 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.布);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a < b && a == 1 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.石头);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 1 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.布);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if (a == 2 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.石头);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.布);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 3 && b == 1)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.剪刀);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 3 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.石头);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if (a ==3 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.刘备, Houquan.石头);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if(a>3) 
                {
                    Console.WriteLine("是不是输错了，再试一次吧！！");
                    UU--;
                }
                Console.WriteLine("是否开始下一轮？<y/n>");
                string QQ = Console.ReadLine();
                if (QQ=="n")
                {
                    break;
                }
                UU++;
            }
            Console.WriteLine("=================================================");
            Console.WriteLine("{0} VS {1}",Computer.刘备,this.name);
            Console.WriteLine("对战次数：{0}",UU);
            Console.WriteLine("姓名\t得分");
            Console.WriteLine("{0}\t{1}",this.name,KK);
            Console.WriteLine("{0}\t{1}",Computer.刘备,JJ);
            if (JJ > KK)
            {
                Console.WriteLine("结果：{0}赢,{1}笨蛋",Computer.刘备,this.name);
            }
            if (JJ < KK)
            {
                Console.WriteLine("结果：{0}赢,{1}笨蛋", this.name, Computer.刘备);
            }
            if (JJ==KK)
            {
                Console.WriteLine("结果：喔喔，你们平分秋色啦！！！");
            }
        }

        public override void SunQuan()
        {
            int UU = 1;
            int JJ = 0;
            int KK = 0;
            Boolean q = true;
            while (q)
            {
                Random ran = new Random();
                int b;
                b = ran.Next(1, 4);
                Console.WriteLine("请出拳：1.剪刀 2.石头 3.布（输入相应数字：）");
                int a = int.Parse(Console.ReadLine());
                if (a == 1 && b == 1)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.剪刀);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a == 2 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.石头);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.石头);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a == 3 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.布);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a < b && a == 1 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.石头);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 1 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.布);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if (a == 2 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.石头);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.布);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 3 && b == 1)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.剪刀);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 3 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.石头);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if (a == 3 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.孙权, Houquan.石头);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if (a > 3)
                {
                    Console.WriteLine("是不是输错了，再试一次吧！！");
                    UU--;
                }
                Console.WriteLine("是否开始下一轮？<y/n>");
                string QQ = Console.ReadLine();
                if (QQ == "n")
                {
                    break;
                }
                UU++;
            }
            Console.WriteLine("=================================================");
            Console.WriteLine("{0} VS {1}", Computer.孙权, this.name);
            Console.WriteLine("对战次数：{0}", UU);
            Console.WriteLine("姓名\t得分");
            Console.WriteLine("{0}\t{1}", this.name, KK);
            Console.WriteLine("{0}\t{1}", Computer.孙权, JJ);
            if (JJ > KK)
            {
                Console.WriteLine("结果：{0}赢,{1}笨蛋", Computer.孙权, this.name);
            }
            if (JJ < KK)
            {
                Console.WriteLine("结果：{0}赢,{1}笨蛋", this.name, Computer.孙权);
            }
            if (JJ == KK)
            {
                Console.WriteLine("结果：喔喔，你们平分秋色啦！！！");
            }
        }

        public override void CaoCao()
        {
            int UU = 1;
            int JJ = 0;
            int KK = 0;
            Boolean q = true;
            while (q)
            {
                Random ran = new Random();
                int b;
                b = ran.Next(1, 4);
                Console.WriteLine("请出拳：1.剪刀 2.石头 3.布（输入相应数字：）");
                int a = int.Parse(Console.ReadLine());
                if (a == 1 && b == 1)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.剪刀);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a == 2 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.石头);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.石头);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a == 3 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.布);
                    Console.WriteLine("和局，真衰，嘿嘿，等着瞧吧！");
                }
                if (a < b && a == 1 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.石头);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 1 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.剪刀);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.布);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if (a == 2 && b == 3)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.石头);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.布);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 3 && b == 1)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.剪刀);
                    Console.WriteLine("笨蛋，{0}输了", this.name);
                    JJ++;
                }
                if (a == 3 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.石头);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if (a == 3 && b == 2)
                {
                    Console.WriteLine("{0}:出拳：{1}", this.name, Houquan.布);
                    Console.WriteLine("{0}:出拳：{1}", Computer.曹操, Houquan.石头);
                    Console.WriteLine("恭喜，{0}赢了", this.name);
                    KK++;
                }
                if (a > 3)
                {
                    Console.WriteLine("是不是输错了，再试一次吧！！");
                    UU--;
                }
                Console.WriteLine("是否开始下一轮？<y/n>");
                string QQ = Console.ReadLine();
                if (QQ == "n")
                {
                    break;
                }
                UU++;
            }
            Console.WriteLine("=================================================");
            Console.WriteLine("{0} VS {1}", Computer.刘备, this.name);
            Console.WriteLine("对战次数：{0}", UU);
            Console.WriteLine("姓名\t得分");
            Console.WriteLine("{0}\t{1}", this.name, KK);
            Console.WriteLine("{0}\t{1}", Computer.刘备, JJ);
            if (JJ > KK)
            {
                Console.WriteLine("结果：{0}赢,{1}笨蛋", Computer.刘备, this.name);
            }
            if (JJ < KK)
            {
                Console.WriteLine("结果：{0}赢,{1}笨蛋", this.name, Computer.刘备);
            }
            if (JJ == KK)
            {
                Console.WriteLine("结果：喔喔，你们平分秋色啦！！！");
            }
        }
    }
}
